I am aware that DOORS provides DXL built in for tracking how many times an object has been modified, days since last mod, days since creation, etc... |
Re: How to gauge how many times Object Text has been modified? I'll code up a function without testing it, if you get it working post it back here.
//****************************
int fCountHistory(Object obj, string NameAttr, Date datSince)
{ // Count the number of History records there are for the object,
// since the datSince, that modified the Attribute.
// When datSince is null, ignore the history date
// When NameAttr is null, count history for any attribute.
// Only History in the Object's version of the module are considered,
// not History in other baselines.
History hst
int CountHist = 0
if (null obj) return(0)
for hst in obj do
{ if (hst.type != modifyObject) continue // Wrong type of History
if (!null datSince and hst.date < datSince) continue // History too old
if (!null NameAttr and hst.attrName != NameAttr) continue // Wrong Attr
Count++ // Found qualifying history
} // end for history in the Object
return(Count)
} // end fCountHistory()
|
Re: How to gauge how many times Object Text has been modified? I suspect, you need to ask -- has this requirement changed since being approved and baselined and if so is the change significant enought to warrant being called a change. I suspect for requirement volatility no one cares if someone bolded a shall or changed a typo. Therefore looking at history without doing a sanity check on history, provides you with data that is garbage for volatility metrics. To get good metrics results -- you need to develop a process that is consistent with your companies needs and capabilities. |
Re: How to gauge how many times Object Text has been modified? SystemAdmin - Wed Nov 11 06:43:12 EST 2009 I have not been able to make the script work yet, but I'll play with it some more. I'm not too strong on coding. |
Re: How to gauge how many times Object Text has been modified? Rich_Mason - Thu Nov 12 08:42:05 EST 2009
Hi Rich,
/** ----------------------------------------------------------------------------
* Counts the number of History records there are for the object,
* since the dateSince, that modified the Attribute.
* Hint:
* Only History in the object's version of the module are considered,
* not History in other baselines.
*
* @visiblity public
* @state in work
* @see
* @precondition
* @postcondition
*
* @param obj - The object whose history shall be evaluated [in]
* @param attrname - The name of the attribute which shall be evaluated, opt. [in]
* If null modifications to all attributes are evaluated.
* @param dateSince - The date since the history shall be evaluated, opt. [in]
* If null ignore the since date an take all history records in account.
* @return The number of history entries which fit the given criteria
*/
int countHistory( Object obj, string attrname, Date dateSince )
{
// Check parameter
if (null obj) return 0
History hst = null
int cnt = 0
// Iterate over all history rcords of the object version
for hst in obj do
{
if (hst.type != modifyObject) continue // Skip all history entries which do not relate to object modifications
if (!null dateSince && (hst.date < dateSince)) continue // Skip all history records which are too old
if (!null attrname && (hst.attrName != attrname)) continue // Skip all history records which do not relate to the referenced attribute
cnt++ // Found qualifying history
}
return cnt
}
//------------------------------------------------------------------
// Testing code
Object obj = current
string attr_name = "" // "Object Text"
Date dateSince = date( "12.11.2009 15:25:00", userLocale, "dd.MM.yyyy")
int cnt = countHistory( obj, attr_name, dateSince )
print cnt
|